package com.chenwei.boot.controller;


import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @BelongsProject: learn-learning-everyday
 * @BelongsPackage: com.chenwei.boot.controller
 * @Author: Chen Wei
 * @CreateTime: 2024-01-20  22:27
 * @Description: TODO
 * @Version: 1.0
 */
@SuppressWarnings("all")
@RestController
@RequestMapping("user")
public class UserController {
    Map<Integer,Object> map=new HashMap<>();

    @GetMapping("set")
    public void getUserList(@RequestParam("index") int index){
        map.put(index,new byte[1024*1024 *300]);
    }
    @GetMapping("rem")
    public void rem(@RequestParam("index") int index){
        map.remove(index);
        System.gc();
    }
}
